import request from '@/utils/system/request'

// 获取数据api
export function getData(data: object) {
  return request({
    url: '/get/merchant?displayCount='+data.pageSize+'&currentPage='+data.page+'&merchantName='+data.merchantName+'&merchantNo='+data.agentName,
	method: 'GET',
    // baseURL: '/mock',
    data
  })
}

export function djapi(data: object) {
  return request({
    url: '/freeze/merchant?merchantUid='+data.roadUid,
    method: 'post',
    // baseURL: '/mock',
    data
  })
}

export function getpoole(data: object) {
  return request({
    url: '/get/all/road',
    method: 'get',
    // baseURL: '/mock',
    // data
  })
}

export function getpool(data: object) {
  return request({
    url: '/get/all/roll/pool',
    method: 'get',
    // baseURL: '/mock',
    data
  })
}

export function chuhua(data: object){
	 // console.log(data.MerchantUid)
	return request({
		url:'/get/one/merchant/deploy?merchantNo='+data.MerchantUid+'&payType='+data.payType,
		method:'get',
	})
}
export function meather(data: object){
	// console.log(data)
	return request({
		url:'/get/one/merchant?merchantUid='+data,
		method:'get',
	})
}
export function agaetmeather(data: object){
	// console.log(data)
	return request({
		url:'get/all/agent',
		method:'get',
	})
}
// 获取数据api
export function getProduct() {
  return request({
    url: '/get/product',
	method: 'GET',
    // baseURL: '/mock',
    // data
  })
}

// 获取数据api
export function getProducthui(data: object) {
  return request({
    url: '/send/notify?bankOrderId='+data.bankOrderId,
	method: 'GET',
    // baseURL: '/mock',
     data
  })
}
// 获取数据api
export function getProducttui(data: object) {
  return request({
    url: '/update/order/status?bankOrderId='+data.bankOrderId+'&solveType=refund',
	method: 'GET',
    // baseURL: '/mock',
     data
  })
}

// 获取数据api
export function handlehuigun(data: object) {
  return request({
    url: 'update/order/status?bankOrderId='+data.bankOrderId+'&solveType=order_roll',
	method: 'GET',
    // baseURL: '/mock',
     data
  })
}
//冻结api

export function getProductdong(data: object) {
  return request({
    url: 'update/order/status?bankOrderId='+data.bankOrderId+'&solveType=freeze_amount',
	method: 'GET',
    // baseURL: '/mock',
     data
  })
}
export function getProductquery(data: object) {
  return request({
    url: '/order/query?bankOrderId='+data.bankOrderId,
	method: 'GET',
    // baseURL: '/mock',
     data
  })
}


export function getProductjie(data: object) {
  return request({
    url: 'update/order/status?bankOrderId='+data.bankOrderId+'&solveType=unfreeze_amount',
	method: 'GET',
    // baseURL: '/mock',
     data
  })
}
// 获取订单详情sapi
export function orderlist(data: object) {
  return request({
    url: '/get/one/order?bankOrderId='+data.BankOrderId,
	method: 'GET',
    // baseURL: '/mock',
     data
  })
}
// 获取分类数据
export function getCategory(data: object) {
  return request({
    url: '/table/category',
    method: 'post',
    baseURL: '/mock',
    data
  })
}

// 获取树组织数据
export function getTree(data: object) {
  return request({
    url: '/table/tree',
    method: 'post',
    baseURL: '/mock',
    data
  })
}

// 新增
export function add(data: object) {
  return request({
    url: '/add/merchant',
    method: 'post',
    // baseURL: '/mock',
    data
  })
}
// 处理
export function addok(data: object) {
  return request({
    url: 'update/order/status?bankOrderId='+data.BankOrderId+'&solveType='+data.radio,
    method: 'GET',
    // baseURL: '/mock',
    data
  })
}
// 编辑
export function update(data: object) {
  return request({
    url: '/reset/mathead/password',
    method: 'post',
    // baseURL: '/mock',
    data
  })
}

// 编辑
export function updateapi(data: object,datauid: object) {
	 // console.log(datauid.payType)
  return request({
    url: '/add/merchant/payType?merchantNo='+datauid.MerchantUid+'&payType='+datauid.payType+'&singleRoad='+data.SingleRoadName+'&singleRoadPlatformFee='+data.SingleRoadPlatformRate+'&singleRoadAgentFee='+data.SingleRoadAgentRate+'&rollPoolRoad='+data.RollRoadName+'&rollRoadPlatformFee='+data.RollRoadPlatformRate+'&rollRoadAgentFee='+data.RollRoadAgentRate+'&isLoan='+data.IsLoan+'&loanRate='+data.LoanRate+'&loanDays='+data.LoanDays+'&unfreezeTimeHour='+data.UnfreezeHour,
    method: 'get',
    // baseURL: '/mock',
    data
  })
}

export function updateapikou(data: object) {
	 console.log(data)
  return request({
    url: '/add/merchant/deploy?merchantName='+data.merchantName+'&merchantNo='+data.MerchantUid+'&isAutoSettle='+data.AutoSettle+'&isAutoPayfor='+data.AutoPayFor+'&ipWhite='+data.WhiteIps+'&payforRoadChoose='+data.SinglePayForRoadName+'&rollPayforRoadChoose='+data.RollPayForRoadName+'&payforFee='+data.PayforFee+'&belongAgentName='+data.BelongAgentName+'&belongAgentUid='+data.BelongAgentUid,
    method: 'get',
    // baseURL: '/mock',
    data
  })
}
// 编辑
export function updateone(data: object) {
  return request({
    url: '/get/oneRoad',
    method: 'post',
    // baseURL: '/mock',
    data
  })
}
// 删除
export function delgl(data: object) {
  return request({
    url: '/delete/merchant',
    method: 'post',
    // baseURL: '/mock',
    data
  })
}